LIB_LINKNAME = vmidicore
LIB = lib$(LIB_LINKNAME).a

FLAGS = -DVMIDI_IMPL_RTMIDI -D__MACOSX_CORE__
LDFLAGS = -framework CoreMIDI -framework CoreFoundation -framework CoreAudio -lpthread

SRCS = \
	vmidi.cpp \
	vmidi_impl_common.cpp \
	vmidi_rtmidi.cpp \
	RtMidi/RtMidi.cpp

INCS = \
	vmidi.h \
	vmidi_impl_common.h \
	vmidi_interface.h \
	vmidi_rtmidi.h \
	RtMidi/RtMidi.h

all: $(LIB) test

$(LIB): $(SRCS) $(INCS)
	\g++ $(FLAGS) -I. -I./RtMidi -c $(SRCS) -Wall
	\ar rcs $(LIB) *.o
	\ranlib $(LIB)
	
test: $(LIB) test.cpp
	\g++ $(LDFLAGS) -o test test.cpp -L. -l$(LIB_LINKNAME) -I. -I./RtMidi

clean:
	\rm -f *.o $(LIB)
	\rm -f test

